// LV重大年份与故事
const lvHistory = [
  { year: "1854", story: "LV品牌创立，路易·威登在巴黎开设第一家箱包店。" },
  { year: "1896", story: "LV经典Monogram帆布诞生，成为品牌标志。" },
  { year: "1987", story: "LV与酩悦轩尼诗合并，成立LVMH集团，成为奢侈品巨头。" },
  { year: "2021", story: "LV持续创新，推出多元化产品，成为全球最具价值奢侈品牌之一。" }
];

function showTimeline() {
  document.getElementById('startBtn').style.display = 'none';
  const timeline = document.getElementById('timeline');
  timeline.classList.add('show');
  // 动态生成年份节点
  setTimeout(() => {
    lvHistory.forEach((item, idx) => {
      const node = document.createElement('div');
      node.className = 'year-node';
      node.innerText = item.year;
      node.style.bottom = (10 + idx * 15) + 'vh';
      node.onclick = () => showDetail(idx);
      timeline.appendChild(node);
      setTimeout(() => node.classList.add('show'), 500 + idx * 300);
    });
  }, 1000);
}

function showDetail(idx) {
  document.querySelector('.page-home').classList.remove('active');
  const detailPage = document.querySelector('.page-detail');
  detailPage.classList.add('active');
  detailPage.querySelector('.detail-content').innerText = lvHistory[idx].story;
}

function backToTimeline() {
  document.querySelector('.page-detail').classList.remove('active');
  document.querySelector('.page-home').classList.add('active');
}

function openH5() {
  alert('H5已打开！');
}

// 支持双击打开
document.addEventListener('DOMContentLoaded', () => {
  document.body.ondblclick = openH5;
}); 